import request from '../../../util/request';
import {userServer} from '../../../config/config';

/**
 * 存储通道
 */
function saveChannel({channelName, strategy, description}) {
	return request(userServer('/api/channel/saveChannel'), {
		data: {channelName, strategy, description}
	});
}

/**
 * 移除通道
 */
function removeChannel({channelName}) {
	return request(userServer('/api/channel/removeChannel'), {
		data: {channelName}
	});
}

/**
 * 获取通道列表
 */
function listChannel() {
	return request(userServer('/api/channel/listChannel'));
}

export {
	saveChannel,
	removeChannel,
	listChannel
}
